package com.example.myblog1_0.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * @Author: xc
 * @Date: 2019/3/22 19:38
 * @Description:
 **/
@Mapper
@Repository
public interface WebMsgMapper {
    @Insert("insert into webMsg(ip) value (#{ip})")
    boolean insertIP(String ip);

    @Select("select count(ip) from webMsg")
    int getIPNum();

    @Select("select * from webMsg where ip = #{ip}")
    String queryIP(String ip);
    @Update("update webMsg set visitorNum=visitorNum+1 where id = 2")
    boolean updateNum();
    @Select("select visitorNum from webMsg where id = 2")
    int getVisitorNum();
}


